Repository navigation
Cap container memory+swap together; allow Postgres server settings - #61
Merged
Merged
Conversation
aersam
marked this pull request as ready for review
October 22, 2026 14:08
A MEM_LIMIT now also sets the memory+swap limit to the same value so the test container cannot spill into swap on small CI agents (override with PGDEVKIT_TESTDB_MEMSWAP_LIMIT, -1 = unlimited). PGDEVKIT_TESTDB_PG_SETTINGS adds -c key=value server settings, e.g. shared_buffers=128MB max_connections=50. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…thout memory limit; bump to 0.17.0 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The on-prem CI agents (
BMS_OnPrem, 4 GB RAM / 2 GB swap each) run out of memory and go down. pgdevkit's sharedpgdevkit-postgrescontainer has no memory cap by default, andPGDEVKIT_TESTDB_MEM_LIMITalone left the swap limit unbounded, so a container "limited" to e.g. 1g could still spill into swap and thrash the agent.Changes
PGDEVKIT_TESTDB_MEM_LIMITnow also setsmemswap_limitto the same value (the--memory-swap=<same>idiom). NewPGDEVKIT_TESTDB_MEMSWAP_LIMIToverrides it (-1= unlimited swap, the old behaviour). Same forPGDEVKIT_TESTDB_MSSQL_*. No limit is applied whenMEM_LIMITis unset, as before.PGDEVKIT_TESTDB_PG_SETTINGS(e.g.shared_buffers=128MB max_connections=50): whitespace-separatedkey=valuepairs (values may contain commas, e.g.search_path=a,b, but no spaces) appended as-c key=valueto the Postgres start command, after the defaults.MEMSWAP_LIMITwithout aMEM_LIMITis ignored (Docker/Podman need both).pyproject.toml,uv.lock).Behaviour change
Anyone who already sets
*_MEM_LIMITnow also gets a matching swap cap. Set*_MEMSWAP_LIMIT=-1to opt out.Not verified
memorycontroller is delegated to the user. Unit tests cover the kwargs passed to the Docker API, not enforcement on the agents; check on a test branch that the container still starts ondevops_onprem-*.pgdevkit-postgreson the agents (podman rm -f pgdevkit-postgres) for them to take effect.🤖 Generated with Claude Code